//
//  AppDelegate.m
//  BVIOS
//
//  Created by 崔晋 on 2019/8/11.
//  Copyright © 2019 xiute. All rights reserved.
//

#import "AppDelegate.h"
#import "BVAppDelegate.h"
#import "BVConstants.h"

@interface AppDelegate ()

@property (strong, nonatomic) BVAppDelegate *bvDelegate;

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self.window makeKeyAndVisible];
    return [self.bvDelegate application:application didFinishLaunchingWithOptions:launchOptions];
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    return [self.bvDelegate application:app openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [self.bvDelegate application:application handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
    return [self.bvDelegate application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}


- (BVAppDelegate *)bvDelegate {
    if (!_bvDelegate) {
        _bvDelegate = [BVAppDelegate shareInstance];
        _bvDelegate.recordWindow = self.window;
    }
    return _bvDelegate;
}

- (UIWindow *)window {
    if (!_window) {
        _window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, kSCREEN_HEIGHT)];
        _window.backgroundColor = [UIColor whiteColor];
    }
    return _window;
}

@end
